import request from '@/utils/request'

// 查询调压设施台账列表
export function listPressure(query) {
  return request({
    url: '/business/pressure/list',
    method: 'get',
    params: query
  })
}

// 查询调压设施台账详细
export function getPressure(id) {
  return request({
    url: '/business/pressure/' + id,
    method: 'get'
  })
}

// 新增调压设施台账
export function addPressure(data) {
  return request({
    url: '/business/pressure',
    method: 'post',
    data: data
  })
}

// 修改调压设施台账
export function updatePressure(data) {
  return request({
    url: '/business/pressure',
    method: 'put',
    data: data
  })
}

// 删除调压设施台账
export function delPressure(id,nhids) {

  
if (nhids.length === 0) {
    return request({
      url: '/business/pressure/single/' + id ,
      method: 'delete',
    })
  } 
   if (nhids.length) {
    console.log('nhids:',nhids);
    return request({
    //  传多个值时，可以这样传
    url: '/business/pressure/' + id + '/' + nhids ,
    method: 'delete',
  })
  } 
}



